package com.chenyun.system.feign;

import com.chenyun.system.model.SysUser;
import com.chenyun.system.param.SysUserQueryPage;
import com.chenyun.common.constants.AppConstans;
import com.chenyun.common.service.IBaseFeignService;
import com.chenyun.common.vo.PageResult;
import com.chenyun.common.vo.ServiceResponse;
import com.chenyun.common.vo.SessionUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 平台|商家后台用户相关
 * @author: Lonni
 * @date: 2023/3/29 0029 9:36
 */
@FeignClient(value = AppConstans.APPLICATION_SYSTEM_NAME,path = AppConstans.AppContextPath.SYSTEM_CONTEXT_PATH)
public interface ISysUserFeign extends IBaseFeignService {


    /**
     * 分页查询商户管理员
     * @param user
     * @return
     */
    @PostMapping(prefix+"listMerchantUserPage")
    PageResult listMerchantUserPage(@RequestBody SysUserQueryPage page);


    /**
     * 添加商户管理用户
     * @param merchantUser
     * @return AjaxResult<Boolean>
     */
    @PostMapping(prefix+"addMerchantUser")
    public ServiceResponse addMerchantUser(@RequestBody SysUser merchantUser);


    /**
     * 修改商户管理用户
     * @param merchantUser
     * @return AjaxResult<Boolean>
     */
    @PostMapping(prefix+"editMerchantUser")
    public ServiceResponse editMerchantUser(@RequestBody SysUser merchantUser);


    /**
     * 删除商户用户
     * @param ids
     * @return AjaxResult<Boolean>
     */
    @PostMapping(prefix+"delMerchantUser")
    public ServiceResponse delMerchantUser(@RequestBody List<String> ids);


    /**
     * 查询平台后台用户
     * @param param
     * @return
     */
    @GetMapping(prefix+"findPlatFormUser")
    public ServiceResponse<SessionUser> findPlatFormUser(@RequestParam Map<String, String> param);

    /**
     * 查询商户后台用户
     * @param param  必须包含merchantId
     * @return
     */
    @GetMapping(prefix+"findMerchantUser")
    public ServiceResponse<SessionUser> findMerchantUser(@RequestParam Map<String, String> param);










}
